
namespace Share
{
    public interface IDataBase
    {
        void DoUpdate();
    }
    public class DataBase<T> : SingletonObject<T>, IDataBase where T : class, new()
    {
        ModifyBase m_Modify = new ModifyBase();
        protected override void OnInit()
        {
            GameMain.Instance.AddDataBase(this);
        }



        // Start is called before the first frame update
        public void Modify()
        {
            m_Modify.MakeModify();
        }
        public virtual void OnPushModify()
        {

        }
        public void DoUpdate()
        {
            if (m_Modify.IsModify)
            {
                OnPushModify();
                m_Modify.ClearModify();
            }
        }
    }

}